package com.yihaodian.search.code.action;

import java.util.List;

import com.opensymphony.xwork2.ActionSupport;
import com.yihaodian.api.search.SugResponse;
import com.yihaodian.api.search.SugResponse.SugResult;
import com.yihaodian.search.code.service.SuggestService;
import com.yihaodian.search.code.service.impl.SuggestServiceImpl;

public class SuggestAction extends ActionSupport {
	private SuggestService sugService = new SuggestServiceImpl();
	
	private List<SugResult> suggestlist;
	private String callback = "123";
	private String keyword;
	
	public String suggest(){
		SugResponse response = sugService.getSuggest(keyword);
		suggestlist = response.getResult();
		return SUCCESS;
	}

	public List<SugResult> getSuggestlist() {
		return suggestlist;
	}

	public String getCallback() {
		return callback;
	}

	public void setCallback(String callback) {
		this.callback = callback;
	}

	public void setKeyword(String keyword) {
		this.keyword = keyword;
	}
}
